# -*- coding: utf-8 -*-
import sys
from PyQt5 import uic, QtCore, QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow, QMenu, QTableWidgetItem, QFileDialog
from log2csv_control import *

class MyMainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        uic.loadUi("eztool.ui", self)  # 将 your_ui_file.ui 替换成你的 ui 文件名
        self.init_stacked_panel()

    def init_stacked_panel(self):
        self.log2csv_widget = Log2CsvWidget()
        self.stackedWidget.addWidget(self.log2csv_widget)
        self.stackedWidget.setCurrentWidget(self.log2csv_widget)
        self.log2csv_pushButton.clicked.connect(self.log2csv_pushButtonCB)
        self.rosbag_pushButton.clicked.connect(self.rosbagrecorder_pushButtonCB)
    
    def log2csv_pushButtonCB(self):
        # 改变stack widget活跃的面板
        self.stackedWidget.setCurrentIndex(0)
    
    def rosbagrecorder_pushButtonCB(self):
        self.stackedWidget.setCurrentIndex(1)
    